<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="review.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String gsCode = request.getParameter("GS_CODE");	
	String wrteId = request.getParameter("id");
	ReviewWritingManager manager = ReviewWritingManager.getInstance();
	ReviewWriting oldWriting = manager.select(Integer.parseInt(wrteId));
%>

<c:set var="GS_CODE" value="<%=gsCode%>" />
<c:set var="oldWriting" value="<%=oldWriting%>" />
		<%
			manager.delete(oldWriting.getWriting_id());
		%>
		<script>
			alert("글이 삭제되었습니다.");
			location.href = "/Dmyna/goods/goodsView.jsp?GS_CODE=${GS_CODE}";
		</script>

<script language="JavaScript">
		if (confirm("글을 삭제하겠습니까?")) {
			location.href = "goodsReviewDelete.jsp";
		} else {
			history.go(-1);
		}
	
</script>
